package com.molichuxing.gateway.bff.order.entity.response;

import com.molichuxing.framework.dto.ResponseRootDto;
import com.molichuxing.services.property.OrderExclusivelStatusEnum;
import com.molichuxing.services.property.OrderPaymentMethodEnum;
import com.molichuxing.services.property.OrderSourceEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 专属里程订单详情基础信息
 * 
 * @author zoumingyu
 * @date 2019年8月24日
 *
 */
@Data
public class OrderExclusivelBaseVo extends ResponseRootDto {
	private static final long serialVersionUID = 4173890625773941505L;

	@ApiModelProperty(value = "订单号")
	private Long orderCode;
	
	@ApiModelProperty(value = "征信类型：1：茉莉征信，2：安鹏征信")
    private Integer type;
	
	@ApiModelProperty(value = "征信类型str")
    private String typeStr;

	@ApiModelProperty(value = "下单时间")
	private LocalDateTime orderTime;

	@ApiModelProperty(value = "订单来源（1：智能终端（AIO），2：手机APP（Android），3：手机APP（IOS），4：微信小程序（APPLET），5：微信公众号（JSAPI），6：H5页面（MWEB））")
	private Integer source;

	@ApiModelProperty(value = "订单来源str")
	private String sourceStr;

	@ApiModelProperty(value = "下单门店id")
	private Integer placeStoreId;

	@ApiModelProperty(value = "下单门店")
	private String placeStoreName;

	@ApiModelProperty(value = "商品编码 ")
	private String goodsCode;

	@ApiModelProperty(value = "商品品类(1：专属，2：订阅) ")
	private Integer businessType;

	@ApiModelProperty(value = "商品品类(业务类型) ")
	private String businessTypeStr;

	@ApiModelProperty(value = "用车时长")
	private Integer transportTime;
	
	@ApiModelProperty(value = "是否回购（0：不回购，1：回购）")
	private Boolean isBuyback;
	
	@ApiModelProperty(value = "是否回购str")
	private String isBuybackStr;

	@ApiModelProperty(value = "总期数")
	private Integer totalPeriods;

	@ApiModelProperty(value = "付款方式（1：一次性付清，2：分期）")
	private Integer paymentMethod;

	@ApiModelProperty(value = "还款周期（1：1个月，n：n个月）")
	private Integer repaymentPeriod;

	@ApiModelProperty(value = "首付期数（1：1期，2：2期，n：n期）")
	private Integer firstTerms;

	@ApiModelProperty(value = "结算日（1：1号...28：28号）")
	private Integer settleDay;

	@ApiModelProperty(value = "车型名称id")
	private Integer vehicleId;

	@ApiModelProperty(value = "车型名称")
	private String vehicleName;

	@ApiModelProperty(value = "车牌号")
	private String licensePlate;

	@ApiModelProperty(value = "车架号")
	private String vin;

	@ApiModelProperty(value = "租金(不含保证金)")
	private BigDecimal cartFee;

	@ApiModelProperty(value = "保证金")
	private BigDecimal deposit;

	@ApiModelProperty(value = "订单总金额（包含保证金）")
	private BigDecimal totalAmount;

	@ApiModelProperty(value = "订单状态()")
	private Integer orderStatus;

	@ApiModelProperty(value = "订单状态str")
	private String orderStatusStr;

	@ApiModelProperty(value = "收车状态（0：未收车，1：收车失败，2：已收车，3：已丢失，4：已报废，5：已售出）")
	private Integer recycleState;

	@ApiModelProperty(value = "收车状态str")
	private String recycleStateStr;

	@ApiModelProperty(value = "收车备注")
	private String recycleRemark;

	@ApiModelProperty(value = "诉讼id")
	private Integer lawsuitId;

	@ApiModelProperty(value = "诉讼状态（1：诉讼中，2：已完成诉讼）")
	private Integer lawsuitState;

	@ApiModelProperty(value = "诉讼状态str")
	private String lawsuitStateStr;

	public OrderExclusivelBaseVo setSource(OrderSourceEnum source) {
		this.source = source == null ? null : source.getValue();
		this.sourceStr = source == null ? null : source.getName();
		return this;
	}

	public OrderExclusivelBaseVo setIsBuyback(Boolean isBuyback) {
		this.isBuyback = isBuyback;
		this.isBuybackStr = isBuyback == null ? null : isBuyback ? "回购" : "不回购";
		return this;
	}

	public OrderExclusivelBaseVo setPaymentMethod(OrderPaymentMethodEnum paymentMethod) {
		this.paymentMethod = paymentMethod == null ? null : paymentMethod.getValue();
		return this;
	}

	public OrderExclusivelBaseVo setOrderStatus(OrderExclusivelStatusEnum orderStatus) {
		this.orderStatus = orderStatus == null ? null : orderStatus.getValue();
		this.orderStatusStr = orderStatus == null ? null : orderStatus.getName();
		return this;
	}
}
